﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta http-equiv="Access-Control-Allow-Origin" content="">
	<meta http-equiv="content-security-policy">
    <link rel="stylesheet" href="../css/mui.min.css" />
    <link rel="stylesheet" href="../css/xyPop.css" />
    <link rel="stylesheet" href="../css/iconfont.css" />
    <link href="../css/base.css" rel="stylesheet" />
    <link href="../css/layout.css" rel="stylesheet" />
    <link rel="stylesheet" href="../css/less.css" />

    <script src="../js/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="../js/mui.min.js"></script>
    <script type="text/javascript" src="../js/app.js"></script>
      <script type="text/javascript" src="../js/xyPop.js"></script>
    <!--<script src="../js/zz.js"></script>-->
    <title>技巧考试</title>
    <script>
        //textType：1模拟考试 2练习 3测试
        var textType = 3;
        //textType等于1时，ContentID： 0小车科目一 1小车科目四 2货车科目一 3货车科目四 4客车科目一 5客车科目四
        //textType不等于1时,ContentID:课程编号
        var ContentID = 0;

        //试题列表
        var arrList = new Array();
        //当前试题索引
        var Selectindex = 0;
        //试题总数
        var total = 0;
        //合格分数
        var PassPoint = 0;

        //用户答题列表
        var AnswerArrList = new Array();
        //关键字是否标红
        var ShowKeyWord = false;
        //答题开始时间
        var BeginTime = new Date();

        //答对自动下一步延迟
        var nexttimer;
        //倒计时
        var timeCount, totalTime;
        var times;

        (function ($, doc) {
            $.ready(function () {
            	
//          	 xyPop({
//                      id: "pop_msg",
//                      title: "技巧讲解",
//                      type:"",
//                      content: '<div class="photo"><img src="../images/instruction/instruction-3.jpg" style="max-width: 100%; max-height: 250px;"></div>',
//                      padding: 10,
//                      btn: ["关闭"],
//                      btn1: function () {
//                          aStop();
//                      },
//                      fixed: true,
//                      onClose: function () { return true; }
//                  });            	
            	
                textType = localStorage.getItem("textType");
                ContentID = localStorage.getItem("ContentID");
                var ContentName = localStorage.getItem("ContentName");
                document.getElementById("testTitle").innerText=ContentName;

                showList();
                BtnClick();
                if (textType != 2) {
                    document.getElementById("SkillBtn").style.display = "none";
                }
            });


        }(mui, document));
        //读取试题
        function showList() {
            var postData = {};
            var param = {};
            param.textType = textType;
            param.TypeID = ContentID;
            postData.param = JSON.stringify(param);

//			CallApi(testShiTi);
//          Skill.GetTest("../js/zz.json", function (data) {
//              if (!data.status) {
//                  mui.alert(data.msg);
//              } else {
//                  CallApi(data);
//              }
//          });
		 $.getJSON("../js/zz.json", function (data){
		 	CallApi(data);
		 });

        }

        function startTime()
        {
            clearInterval(times);
            timer();
        }
        //计时
        function timer()
        {
            times = setInterval(function () {
                if (timeCount > 0) {
                    timeCount--;
                    var minute = parseInt(timeCount / 60);
                    var seconds = timeCount % 60;
                    $("#TimeSpan").html(minute + "分" + seconds + "秒");
                }
                else {

                    SubmitTest();
                }
            }, 1000);

        }


       function CallApi(res) {
            if (res.rows.length == 0)
            {
                mui.alert('未能找到试题');
                return;
            }
            if (textType != 2) {
                totalTime = res.Time * 60;
                timeCount = res.Time * 60;
                document.getElementById("SubmitTestBtn").style.display = "";
                startTime();
            }
            if (!ShowKeyWord) {
                if (res.ShowKeyWord.indexOf(textType) != -1) {
                    ShowKeyWord = true;
                }
            }
            PassPoint = res.PassPoint;//通过分数,试题通过分数。

            //试题列表
            arrList = res.rows;
            total = res.rows.length;
            //用户答题赋值
            AnswerArrList = new Array();
            for (var i = 0; i < arrList.length; i++) {
                //index索引 qb_id试题编号 TextType试题类型 qb_answer试题答案 qb_Point试题分数 IsAnswer是否已答题 IsRight是否正确
                AnswerArrList.push({ "index": i, "qb_id": arrList[i].qb_id, "TextType": arrList[i].TextType, "qb_answer": arrList[i].qb_answer, "qb_Point": arrList[i].qb_Point, "IsAnswer": false, "IsRight": false, "A": false, "B": false, "C": false, "D": false });
            }
            Selectindex = 0;
            //默认选中第1题目
            SetItem();


        }
        //选中
       function SetItem() {
           if (arrList.length == 0) {
               mui.alert('未能找到试题');
               return;
           }
           var timu = arrList[Selectindex];
           document.getElementById("divselect").style.display = "none";
           //题号
           document.getElementById("selecttihao").innerHTML = '<i class="icon-leimu iconfont"></i><p><span>'+(Selectindex+1)+'</span>/<span>'+total+'</span></p>';
           //题目类型
           var TextTypeName = '';
           if (timu.TextType == 1) {
               TextTypeName = '判断题';
           }
           else if (timu.TextType == 2) {
               TextTypeName = '单选题';
           }
           else if (timu.TextType == 3) {
               TextTypeName = '多选题';
           }
           document.getElementById("answerstype").innerHTML = TextTypeName;
           //题目标题
           //关键字标红
           var qb_content = timu.qb_content;
           var qb_candidateA = timu.qb_candidateA;
           var qb_candidateB = timu.qb_candidateB;
           var qb_candidateC = timu.qb_candidateC;
           var qb_candidateD = timu.qb_candidateD;

           document.getElementById("answerstimu").innerHTML = qb_content;

           //题目图片
           if (timu.qb_address != null && timu.qb_address != undefined && timu.qb_address != "") {
               document.getElementById("answersimg").innerHTML = '<img src="' + timu.qb_address + '" >';
           }
           else {
               document.getElementById("answersimg").innerHTML = '';
           }

           //题目答案
           var answersHtml = '<ul class="fixed">';
           if (qb_candidateA == "√" || qb_candidateA == "×") {
               answersHtml+='<li id="answer_a"><i>A</i><span class="judgment">' + qb_candidateA + '</span></li>';
           }
           else {
               answersHtml += '<li id="answer_a"><i>A</i><span>' + qb_candidateA + '</span></li>';
           }
           if (qb_candidateB == "√" || qb_candidateB == "×") {
               answersHtml += '<li id="answer_b"><i>B</i><span class="judgment">' + qb_candidateB + '</span></li>';
           }
           else {
               answersHtml += '<li id="answer_b"><i>B</i><span>' + qb_candidateB + '</span></li>';
           }

            if (timu.qb_candidateC != null && timu.qb_candidateC != undefined && timu.qb_candidateC != "")
                answersHtml += '<li id="answer_c"><i>C</i><span>' + qb_candidateC + '</span></li>';
            if (timu.qb_candidateD != null && timu.qb_candidateD != undefined && timu.qb_candidateD != "")
                answersHtml += '<li id="answer_d"><i>D</i><span>' + qb_candidateD + '</span></li>';
            answersHtml += "</ul>";

            if (timu.TextType != 1 && timu.TextType != 2)
                answersHtml += ' <div class="multiselect"><a href="#" class="btn-primary" id="answertrue">确定</a></div>';
            document.getElementById("answers").innerHTML = answersHtml;




            //A答案选择
            var answer_a = document.getElementById('answer_a');
            answer_a.addEventListener('tap', function (event) {
                answerClick("a");
            });
            //B答案选择
            var answer_b = document.getElementById('answer_b');
            answer_b.addEventListener('tap', function (event) {
                answerClick("b");
            });
            //C答案选择
            var answer_c = document.getElementById('answer_c');
            if (answer_c != null) {
                answer_c.addEventListener('tap', function (event) {
                    answerClick("c");
                });
            }
            //D答案选择
            var answer_d = document.getElementById('answer_d');
            if (answer_d != null) {
                answer_d.addEventListener('tap', function (event) {
                    answerClick("d");
                });
            }
            //确定
            var answertrue = document.getElementById('answertrue');
            if (answertrue != null) {
                answertrue.addEventListener('tap', function (event) {
                    AnswerTrue3();
                });
            }
            ShowResult(false);

        }
        //上一题
        function LastExam() {
            Selectindex = Selectindex - 1;
            if (Selectindex <= 0)
            {
                Selectindex = 0;
            }
            SetItem();
        }
        //下一题
        function NextExam()
        {
            clearInterval(nexttimer);
            Selectindex = Selectindex + 1;
            if (Selectindex >= total) {
                Selectindex = total - 1;
                return;
            }
            SetItem();
        }
        //重做
        function RestTest() {
            document.getElementById("alltest").style.display = "";
            document.getElementById("RestTestBtn").style.display = "";
            document.getElementById("Result_ALl").style.display = "none";
            document.getElementById("Result_Qualified").style.display = "none";
            document.getElementById("Result_NoQualified").style.display = "none";
            millisecond = hour = minute = second = 0;
            showList();
        }
        //错题重做
        function ErrorRestTest() {
            document.getElementById("alltest").style.display = "";
            document.getElementById("RestTestBtn").style.display = "none";
            document.getElementById("Result_ALl").style.display = "none";
            document.getElementById("Result_Qualified").style.display = "none";
            document.getElementById("Result_NoQualified").style.display = "none";
            millisecond = hour = minute = second = 0;
            var allPassPoint = 0;
            for (var i = 0; i < AnswerArrList.length; i++) {
                if (AnswerArrList[i].IsRight) {
                    for (var y = 0; y < arrList.length; y++) {
                        if (AnswerArrList[i].qb_id == arrList[y].qb_id) {
                            arrList.splice(y, 1);
                            break;
                        }
                    }
                }
                else {
                    allPassPoint += AnswerArrList[i].qb_Point;
                }
            }
            var data = {};
            data.rows = arrList;
            data.PassPoint = allPassPoint;
            data.Time = 60;
            CallApi(data)

        }
        //加载选项卡
        function LoadSelect() {

            //正确的答题数
            var rightNumber = 0;
            //错误的答题数
            var errorNumber = 0;

            var ul_select = document.getElementById("ul_select");
            var selecthtml = "";
            for (var i = 0; i < AnswerArrList.length; i++) {
                if (i == Selectindex)
                { selecthtml += ' <li><a href="#" index="' + (i + 1) + '" class="on"><span>' + (i + 1) + '</span></a></li>';

                }
                else if (!AnswerArrList[i].IsAnswer) {
                    selecthtml += ' <li><a href="#" index="' + (i + 1) + '" ><span>' + (i + 1) + '</span></a></li>';
                }
                else {
                    if (AnswerArrList[i].IsRight) {
                        rightNumber = rightNumber + 1;
                        selecthtml += ' <li><a href="#" class="green" index="' + (i + 1) + '"><span>' + (i + 1) + '</span></a></li>';
                    }
                    else {
                        errorNumber = errorNumber + 1;
                        selecthtml += ' <li><a href="#" class="red" index="' + (i + 1) + '"><span>' + (i + 1) + '</span></a></li>';
                    }
                }

            }
            ul_select.innerHTML = selecthtml;
            document.getElementById("selectright").innerHTML = rightNumber;
            document.getElementById("selecterror").innerHTML = errorNumber;
            document.getElementById("selectrate").innerHTML = (rightNumber + errorNumber) == 0 ? "0%" : (rightNumber / (rightNumber + errorNumber) * 100).toFixed(2) + "%";

            document.getElementById("divselect").style.display = "";

            var ul_select = document.getElementById("ul_select");
            for (var i = 0; i < ul_select.children.length; i++) {
                ul_select.children[i].firstChild.addEventListener('tap', function (event) {
                    var index = this.getAttribute("index");
                    Selectindex = index - 1;
                    SetItem();

                });

            }


        }
      //答案选择
        function answerClick(abcd)
        {
            var answertimu = AnswerArrList[Selectindex];
            if (answertimu.IsAnswer != true)
            {
                if (abcd == "a") {
                    if (answertimu.A) {
                        answertimu.A = false;
                        document.getElementById("answer_a").className = "";
                    }
                    else {
                        answertimu.A = true;
                        document.getElementById("answer_a").className = "on";
                    }
                }
                else if (abcd == "b") {
                    if (answertimu.B) {
                        answertimu.B = false;
                        document.getElementById("answer_b").className = "";
                    }
                    else {
                        answertimu.B = true;
                        document.getElementById("answer_b").className = "on";
                    }
                }
                else if (abcd == "c") {
                    if (answertimu.C) {
                        answertimu.C = false;
                        document.getElementById("answer_c").className = "";
                    }
                    else {
                        answertimu.C = true;
                        document.getElementById("answer_c").className = "on";
                    }
                }
                else if (abcd == "d") {
                    if (answertimu.D) {
                        answertimu.D = false;
                        document.getElementById("answer_d").className = "";
                    }
                    else {
                        answertimu.D = true;
                        document.getElementById("answer_d").className = "on";
                    }
                }
                //单选或者判断题 选中 答案就直接显示
                if (answertimu.TextType != 3)
                {
                    AnswerTrue3();
                }
            }
        }
        //多选题确定
        function AnswerTrue3()
        {
            var answertimu = AnswerArrList[Selectindex];
            answertimu.IsAnswer = true;
            ShowResult(true);
        }

        //显示答题结果:autoNext是否自动下一题
        function ShowResult(autoNext)
        {
            var answertimu = AnswerArrList[Selectindex];
            if (answertimu.IsAnswer == true) {
                document.getElementById("answer_a").className = answertimu.A ? "on" : "";
                document.getElementById("answer_b").className = answertimu.B ? "on" : "";
                if (document.getElementById("answer_c") != null) document.getElementById("answer_c").className = answertimu.C ? "on" : "";
                if (document.getElementById("answer_d") != null) document.getElementById("answer_d").className = answertimu.D ? "on" : "";

                var AnswerStr = "";
                if (answertimu.A) AnswerStr += "A";
                if (answertimu.B) AnswerStr += "B";
                if (answertimu.C) AnswerStr += "C";
                if (answertimu.D) AnswerStr += "D";
                if (AnswerStr == answertimu.qb_answer) {
                    answertimu.IsRight = true;
                    if (autoNext) {
                         nexttimer = setInterval(NextExam, 1000);
                    }
                }
                else {
                    //练习:做错的时候弹出技巧讲解
                    if (textType == 2) {
                        if (autoNext) {
                            SkillExplain();
                        }
                    }
                    answertimu.IsRight = false;
                }
                ShowAnswerState(answertimu.qb_answer, AnswerStr);
            }
            else {

                document.getElementById("answer_a").className =  "";
                document.getElementById("answer_b").className =  "";
                if (document.getElementById("answer_c") != null) document.getElementById("answer_c").className =  "";
                if (document.getElementById("answer_d") != null) document.getElementById("answer_d").className =  "";
            }
        }
        //处理答题的状态 正确答案,选择答案
        //correct正确
        //wrong错误
        //on选中
        function ShowAnswerState(OldAnswer, NewAnswer) {

            //答题正确
            if (OldAnswer == NewAnswer) {
                if (OldAnswer.indexOf("A") != -1) document.getElementById("answer_a").className = "correct on";
                if (OldAnswer.indexOf("B") != -1) document.getElementById("answer_b").className = "correct on";
                if (OldAnswer.indexOf("C") != -1 && document.getElementById("answer_c") != null) document.getElementById("answer_c").className = "correct on";
                if (OldAnswer.indexOf("D") != -1 && document.getElementById("answer_c") != null) document.getElementById("answer_d").className = "correct on";
            }
                //答题错误
            else {
                if (OldAnswer.indexOf("A") != -1) document.getElementById("answer_a").className = "correct";
                if (OldAnswer.indexOf("B") != -1) document.getElementById("answer_b").className = "correct";
                if (OldAnswer.indexOf("C") != -1 && document.getElementById("answer_c") != null) document.getElementById("answer_c").className = "correct";
                if (OldAnswer.indexOf("D") != -1 && document.getElementById("answer_c") != null) document.getElementById("answer_d").className = "correct";



                if (NewAnswer.indexOf("A") != -1)
                { if (OldAnswer.indexOf("A") != -1) { document.getElementById("answer_a").className = "correct on"; } else { document.getElementById("answer_a").className = "wrong on"; } };
                if (NewAnswer.indexOf("B") != -1)
                { if (OldAnswer.indexOf("B") != -1) { document.getElementById("answer_b").className = "correct on"; } else { document.getElementById("answer_b").className = "wrong on"; } };
                if (NewAnswer.indexOf("C") != -1 && document.getElementById("answer_c") != null)
                { if (OldAnswer.indexOf("C") != -1) { document.getElementById("answer_c").className = "correct on"; } else { document.getElementById("answer_c").className = "wrong on"; } };
                if (NewAnswer.indexOf("D") != -1 && document.getElementById("answer_d") != null)
                { if (OldAnswer.indexOf("D") != -1) { document.getElementById("answer_d").className = "correct on"; } else { document.getElementById("answer_d").className = "wrong on"; } };



                var timu = arrList[Selectindex];
                //题目标题
                //关键字标红
                var qb_content = timu.qb_content;
                var qb_candidateA = timu.qb_candidateA;
                var qb_candidateB = timu.qb_candidateB;
                var qb_candidateC = timu.qb_candidateC;
                var qb_candidateD = timu.qb_candidateD;
                if (ShowKeyWord) {
                    if (timu.qb_keyword != "" && timu.qb_keyword != null) {
                        var keys = timu.qb_keyword.split(',');
                        for (var i = 0; i < keys.length; i++) {
                            qb_content = ReplaceAll(qb_content,keys[i], '<span class="red">' + keys[i] + '</span>');

                            qb_candidateA = ReplaceAll(qb_candidateA,keys[i], '<span class="red">' + keys[i] + '</span>');
                            qb_candidateB = ReplaceAll(qb_candidateB, keys[i], '<span class="red">' + keys[i] + '</span>');
                            qb_candidateC = ReplaceAll(qb_candidateC, keys[i], '<span class="red">' + keys[i] + '</span>');
                            qb_candidateD = ReplaceAll(qb_candidateD, keys[i], '<span class="red">' + keys[i] + '</span>');
                        }
                    }
                }
                document.getElementById("answerstimu").innerHTML = qb_content;
                if (timu.qb_candidateA == "√" || timu.qb_candidateA == "×") {
                    document.getElementById("answer_a").innerHTML = '<i>A</i><span class="judgment">' + qb_candidateA + '</span>';
                    document.getElementById("answer_b").innerHTML = '<i>B</i><span class="judgment">' + qb_candidateB + '</span>';
                }
                else {
                    document.getElementById("answer_a").innerHTML = '<i>A</i><span>' + qb_candidateA + '</span>';
                    document.getElementById("answer_b").innerHTML = '<i>B</i><span >' + qb_candidateB + '</span>';;
                }

                if (timu.qb_candidateC != null && timu.qb_candidateC != undefined && timu.qb_candidateC != "")
                    document.getElementById("answer_c").innerHTML = '<i>C</i><span>' + qb_candidateC + '</span>';
                if (timu.qb_candidateD != null && timu.qb_candidateD != undefined && timu.qb_candidateD != "")
                    document.getElementById("answer_d").innerHTML = '<i>D</i><span>' + qb_candidateD + '</span>';
            }
        }

        //技巧讲解
        function SkillExplain()
        {
            document.getElementById("SkillAudio").src = arrList[Selectindex].qb_skillaudio;
            aPlay();
 			 xyPop({
                        id: "pop_msg",
                        title: "技巧讲解",
                        type:"",
                        content: '<div class="photo" style="text-algin:center"><img src="' + arrList[Selectindex].qb_skillpicture + '" style="max-width: 100%; max-height: 250px; display:block;margin:0 auto;"></div>',
                        padding: 10,
                        btn: ["关闭"],
                        btn1: function () {
                            aStop();
                        },
                        fixed: true,
                        onClose: function () { return true; }
                    });
        }
        //交卷
        function SubmitTest()
        {
            clearInterval(times);
            var usertime = totalTime - timeCount;
            var minute = parseInt(usertime / 60);
            var second = usertime % 60;

            document.getElementById("alltest").style.display = "none";
            //总分
            var allPoint = 0;
            //合格分数
            var rightPoint = 0;
            for (var i = 0; i < AnswerArrList.length; i++) {
                allPoint = allPoint + AnswerArrList[i].qb_Point;
                if (AnswerArrList[i].IsRight) {
                    rightPoint = rightPoint + AnswerArrList[i].qb_Point;
                }
            }
            //满分
            if (rightPoint == allPoint) {
                document.getElementById("Result_ALl").style.display = "";
                document.getElementById("Result_ALl_NowPoint").innerHTML = rightPoint;
                document.getElementById("Result_ALl_AllPoint").innerHTML = allPoint;
                document.getElementById("Result_ALl_PassPoint").innerHTML = PassPoint;
                document.getElementById("Result_ALl_Timers").innerHTML = minute + '分' + second + '秒';
            }
                //合格
            else if (rightPoint >= PassPoint) {
                document.getElementById("Result_Qualified").style.display = "";
                document.getElementById("Result_Qualified_NowPoint").innerHTML = rightPoint;
                document.getElementById("Result_Qualified_AllPoint").innerHTML = allPoint;
                document.getElementById("Result_Qualified_PassPoint").innerHTML = PassPoint;
                document.getElementById("Result_Qualified_Timers").innerHTML =  minute + '分' + second + '秒';
            }
                //不合格
            else {
                document.getElementById("Result_NoQualified").style.display = "";
                document.getElementById("Result_NoQualified_NowPoint").innerHTML = rightPoint;
                document.getElementById("Result_NoQualified_AllPoint").innerHTML = allPoint;
                document.getElementById("Result_NoQualified_PassPoint").innerHTML = PassPoint;
                document.getElementById("Result_NoQualified_Timers").innerHTML =  minute + '分' + second + '秒';
            }
        }
        function BtnClick()
        {
            //选项卡显示按钮
            var selecttihao = document.getElementById('selecttihao');
            selecttihao.addEventListener('tap', function (event) {
                LoadSelect();
            });
            //选项卡关闭按钮
            var closeselect = document.getElementById("closeselect");
            closeselect.addEventListener('tap', function (event) {
                document.getElementById("divselect").style.display = "none";
            });


            //上一题
            var LastBtn = document.getElementById('LastBtn');
            LastBtn.addEventListener('tap', function (event) {
                LastExam();
            });
            //下一题
            var NextBtn = document.getElementById('NextBtn');
            NextBtn.addEventListener('tap', function (event) {
                NextExam();
            });

            //技巧讲解
            var SkillBtn = document.getElementById('SkillBtn');
            SkillBtn.addEventListener('tap', function (event) {
                SkillExplain();               
            });


            //交卷
            var SubmitTestBtn = document.getElementById('SubmitTestBtn');
            SubmitTestBtn.addEventListener('tap', function (event) {
                var btnArray = ['否', '是'];
                mui.confirm('是否确定交卷，确认？', '警告', btnArray, function (e) {
                    if (e.index == 1) {
                        SubmitTest();
                    }
                 
                })
            });


            //重做
            var RestTestBtn = document.getElementById('RestTestBtn');
            RestTestBtn.addEventListener('tap', function (event) {
                RestTest();
            });
            //不合格重做
            var Result_NoQualified_Rest = document.getElementById('Result_NoQualified_Rest');
            Result_NoQualified_Rest.addEventListener('tap', function (event) {
                RestTest();
            });
            //合格重做
            var Result_Qualified_Rest = document.getElementById('Result_Qualified_Rest');
            Result_Qualified_Rest.addEventListener('tap', function (event) {
                RestTest();
            });
            //满分重做
            var Result_ALl_Rest = document.getElementById('Result_ALl_Rest');
            Result_ALl_Rest.addEventListener('tap', function (event) {
                RestTest();
            });

            //错题重做
            var Result_NoQualified_ErrorRest = document.getElementById('Result_NoQualified_ErrorRest');
            Result_NoQualified_ErrorRest.addEventListener('tap', function (event) {
                ErrorRestTest();
            });
            var Result_Qualified_ErrorRest = document.getElementById('Result_Qualified_ErrorRest');
            Result_Qualified_ErrorRest.addEventListener('tap', function (event) {
                ErrorRestTest();
            });

            //图片放大隐藏
            document.getElementById("answersimg").addEventListener('tap', function () {
                
                $("#photo2").attr("src", document.getElementById("answersimg").firstChild.src);
                $(".mui-popup").fadeIn(0);
                $(".mui-popup-backdrop").fadeIn(0);
            });

            document.getElementById("backdrop").addEventListener('tap', function () {
                $(".mui-popup").fadeOut(0);
                $(".mui-popup-backdrop").fadeOut(0);
            });

            document.getElementById("photo2").addEventListener('tap', function () {
                $(".mui-popup").fadeOut(0);
                $(".mui-popup-backdrop").fadeOut(0);
            });

        }

        //讲解播放
        function aPlay() {
            document.getElementById("SkillAudio").play();
        }
        //讲解停止播放
        function aStop() {
            document.getElementById("SkillAudio").currentTime = 0;
            document.getElementById("SkillAudio").pause();
        }


        function ReplaceAll(str, strOld, strNew) {
            var strItems = str.split(strOld);
            if (strItems.length == 0)
            {
                return str;
            }
            var RstrNew = "";
            for (var i = 0; i < strItems.length; i++) {
                if (i == strItems.length - 1) {
                    RstrNew += strItems[i];
                }
                else {
                    RstrNew += strItems[i] + strNew;
                }
            }
            return RstrNew;
        }

    </script>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 class="mui-title" id="testTitle"></h1>
	</header>
	
<div class="mui-content">
    <div id="alltest">
        <div class="test-nav">
            <div class="nav-content">
                <ul>
                    <li id="LastBtn"><a><i class="icon-arrow-left iconfont"></i><p>上一题</p></a></li>

                    <li id="selecttihao"><a class="tihao"></a></li>
                    <li id="SkillBtn"><a><i class="icon-huatong iconfont"></i><p>技巧讲解</p></a></li>
                    <li id="NextBtn"><a><i class="icon-arrow-right iconfont"></i><p>下一题</p></a></li>
                </ul>
            </div>
        </div>

        <header class="header test-fixed">
            <div class="fixed test-header">
                <a id="RestTestBtn" class="reset"><i class="icon-reset iconfont"></i>重做</a>
                <span id="TimeSpan"></span>
                <a id="SubmitTestBtn" class="submit" style="display:none"><i class="icon-shangchuan iconfont"></i>交卷</a>
            </div>
        </header>
        <div class="content exam-content">
            <div class="question question-padding">
                <dl>
                    <dt><span class="radio" id="answerstype"></span><span class="tit" id="answerstimu"></span></dt>
                    <dd class="question-img" id="answersimg"></dd>
                    <dd id="answers">
                        <ul class="fixed"></ul>
                        <div class="multiselect" style="display:none"><a href="#" class="btn-primary">确定</a></div>
                    </dd>
                </dl>
            </div>

        </div>
        <div class="question-num" style="display:none;" id="divselect">
            <div class="question-num-content" style="height:70%">
                <div class="result" style="height:11%">
                    <div>
                        <span>正确：<b class="green" id="selectright"></b></span>
                        <span>错误：<b class="red" id="selecterror"></b></span>
                        <span>正确率：<b class="orange" id="selectrate"></b></span>
                        <a class="close" id="closeselect">关闭</a>
                    </div>
                </div>
                <div class="num">
                    <ul class="fixed" id="ul_select"></ul>
                </div>
            </div>
        </div>

        <audio src="" id="SkillAudio"></audio>

    </div>



    <div id="Result_NoQualified" class="testResult-content" style="display:none;">
        <dl>
            <dt><img src="../images/score-fail.jpg" width="85%"><p>抱歉，测试未通过！</p></dt>
            <dd>
                <ul class="fixed score">
                    <li class="score-txt"><span id="Result_NoQualified_NowPoint"></span>分</li>
                    <li class="score-date">
                        满分：<span id="Result_NoQualified_AllPoint"></span><br>合格：<span id="Result_NoQualified_PassPoint"></span><br>用时 ：<span id="Result_NoQualified_Timers"></span>
                    </li>
                </ul>
            </dd>
            <dd>
                <p class="tip">学车之路，任重而道远！<br>路漫漫其修远兮，吾将上下而求索。</p>
            </dd>
            <dd class="btn">
                <ul>
                    <li><a class="btn-primary" href="#" id="Result_NoQualified_ErrorRest">错题重做</a></li>
                    <li><a class="btn-green" href="#" id="Result_NoQualified_Rest">重新测试</a></li>
                </ul>
            </dd>
        </dl>
    </div>
    <div id="Result_Qualified" class="testResult-content" style="display:none;">
        <dl>
            <dt><img src="../images/score-pass.jpg" width="85%"><p>恭喜，测试通过！</p></dt>
            <dd>
                <ul class="fixed score">
                    <li class="score-txt"><span id="Result_Qualified_NowPoint"></span>分</li>
                    <li class="score-date">
                        满分：<span id="Result_Qualified_AllPoint"></span><br>合格：<span id="Result_Qualified_PassPoint"></span><br>用时 ：<span id="Result_Qualified_Timers"></span>
                    </li>
                </ul>
            </dd>
            <dd>
                <p class="tip">天赋异禀、骨骼惊奇,<br>想来是百年难得一见的考试奇才</p>
            </dd>
            <dd class="btn">
                <ul>
                    <li><a class="btn-primary" href="#" id="Result_Qualified_ErrorRest">错题重做</a></li>
                    <li><a class="btn-green" href="#" id="Result_Qualified_Rest">重新测试</a></li>
                </ul>
            </dd>
        </dl>
    </div>
    <div id="Result_ALl" class="testResult-content" style="display:none;">
        <dl>
            <dt><img src="../images/score-full-marks.jpg" width="85%"><p>恭喜，测试通过！</p></dt>
            <dd>
                <ul class="fixed score">
                    <li class="score-txt"><span id="Result_ALl_NowPoint"></span>分</li>
                    <li class="score-date">
                        满分：<span id="Result_ALl_AllPoint"></span><br>合格：<span id="Result_ALl_PassPoint"></span><br>用时 ：<span id="Result_ALl_Timers"></span>
                    </li>
                </ul>
            </dd>
            <dd>
                <p class="tip">地球人已经无法阻止我了<br>所以我要去火星拯救世界去了！</p>
            </dd>
            <dd class="btn">
                <ul>
                    <li><a class="btn-green" href="#" id="Result_ALl_Rest">重新测试</a></li>
                </ul>
            </dd>
        </dl>
    </div>

    <div class="mui-popup mui-popup-in" style="width:100%; display:none;"><div class="photo2"><img id="photo2"></div></div>
    <div class="mui-popup-backdrop mui-active" id="backdrop" style="display: block;display: none;"></div>
</div>
</body>

</html>
